package com.atguigu.gulimall.search.controller;

import com.atguigu.gulimall.search.service.MallSearchSevice;
import com.atguigu.gulimall.search.vo.SearchParam;
import com.atguigu.gulimall.search.vo.SearchReslut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class SearchController {
    @Autowired
    private MallSearchSevice mallSearchSevice;
    @GetMapping(value = "/list.html")
    public  String listpage(SearchParam param, Model model){
     SearchReslut result=  mallSearchSevice.querySearch(param);
     model.addAttribute("result",result);
        return "list";
    }
}
